Skip to content

fix(server): accept DeepSeek named JSON tool calls - #631

Merged
davide221 merged 2 commits into
Luce-Org:mainfrom
pepuscz:fix/deepseek4-tool-json
Aug 19, 2026
Merged

fix(server): accept DeepSeek named JSON tool calls#631
davide221 merged 2 commits into
Luce-Org:mainfrom
pepuscz:fix/deepseek4-tool-json

Conversation

@pepuscz

@pepuscz pepuscz commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Accept the named bare-JSON tool-call fallbacks emitted by DeepSeek-compatible checkpoints:

{"function":"get_weather","parameters":{"location":"Prague"}}

and the legacy envelope:

{"function_call":{"name":"get_weather","arguments":{"location":"Prague"}}}

The streaming emitter now buffers a leading JSON object when multiple tools are declared. Final parsing still requires an allowed tool name; an ordinary JSON response that does not resolve to an allowed tool is returned unchanged as assistant content. DeepSeek V4 tool capability is advertised through /props.

Published qualification patches:

Validation

  • Added parser, multi-tool streaming, ordinary-JSON fallback, and /props unit coverage
  • Compiled the current-main parser/emitter locally and ran focused named-call, legacy-call, multi-tool, and non-tool JSON assertions
  • git diff --check

This complements #627: that PR handles <function_calls> XML emitted inside reasoning, while this change handles named bare-JSON fallback forms.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 5 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread server/src/server/tool_parser.cpp Outdated
Comment thread server/test/test_server_unit.cpp Outdated
@davide221
davide221 merged commit e79f1b6 into Luce-Org:main Aug 19, 2026
11 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants